const { execFile } = require('child_process');
const path = require('path');

const exePath = path.join(__dirname, 'paige.exe');
const iconPath = path.join(__dirname, 'paige.ico');
const rceditPath = path.join(__dirname, 'node_modules', 'rcedit', 'bin', 'rcedit.exe');

console.log('EXE Path:', exePath);
console.log('Icon Path:', iconPath);
console.log('rcedit Path:', rceditPath);

execFile(rceditPath, [exePath, '--set-icon', iconPath], (error, stdout, stderr) => {
  if (error) {
    console.error('Failed to set icon:', error);
    console.error('stderr:', stderr);
    return;
  }
  console.log('Icon set successfully');
  console.log('stdout:', stdout);
});
